{template header}

<!--{if $webglobal[mode]=='purviewgroup'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>权限分组管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=purviewgroupadd">[添加权限分组]</a>
			</td></tr>
		</tbody>
	</table>
	<form id="purviewgroupform" name="editform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=purviewgroupedit&check">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr>
				<!-- <th width="5%"></th> -->
				<th width="10%">编号</th>
				<th>分组名称</th>
				<th width="5%">排序</th>
			</tr>
		</thead>
		<tbody>
			<!--{if $webglobal[page_purview][dataarray]}-->
				<!--{loop $webglobal[page_purview][dataarray] $tempkey $temptable}-->
					<tr>
						<!-- <td{$temptable[tdclass]}><input type="checkbox" name="delid[]" value="{$tempkey}" /></td> -->
						<td{$temptable[tdclass]}>$temptable[id]</td>
						<td{$temptable[tdclass]}><input type="text" name="name[{$tempkey}]" value="{$temptable[name]}" style="width:300px" /></td>
						<td{$temptable[tdclass]}><input type="text" name="order[{$tempkey}]" value="{$temptable[order]}" style="width:50px" /></td>
					</tr>
				<!--{/loop}-->
			<!--{else}-->
				<tr><td colspan="5" style="text-align: center">暂时还没有权限分组。</td></tr>
			<!--{/if}-->
		</tbody>
	</table>
	<table style="width:100%;border-style:none;" cellpadding="0" cellspacing="0">
		<tr>
			<td style="width:80px;margin:0;padding:0;"><input type="submit" name="adminsubmit" value=" 批量更改 " /></td>
		</tr>
	</table>
	</form>
<!--{elseif $webglobal[mode]=='purviewgroupadd'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>权限分组管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=purviewgroup">[权限分组列表]</a>
			</td></tr>
		</tbody>
	</table>
	<form name="addform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=purviewgroupadd&check">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">添加权限分组</td></tr>
		</thead>
		<tbody>
			<tr>
				<th>分组名称<span class="need"> *</span></th>
				<td>
					<input type="text" name="name" size="40" value="" />
				</td>
			</tr>
			<tr>
				<th>权重<div>越大越排前面</div></th>
				<td>
					<input type="text" name="order" size="10" value="0" />
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="2">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{elseif $webglobal[mode]=='purview'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>权限管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=purviewadd">[添加权限]</a>
			</td></tr>
		</tbody>
	</table>
	<!--{if $webglobal[page_purview][dataarray]}-->
	<div class="menutitle">
	<h3>权限分组</h3>
	<ul id="submenu">
		<!--{loop $webglobal[page_purview][dataarray] $groupid $groupvalue}-->
		<li{if $groupvalue[groupnum] == 1} class="current"{/if} onclick="showanchor(this)" href="tab_{$groupid}"><a href="#"><span>{$groupvalue[name]}</span></a></li>
		<!--{/loop}-->
	</ul>
	</div>
	<!--{/if}-->

	<form name="editform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=purviewedit&check">
	<!--{if $webglobal[page_purview][dataarray]}-->
	<!--{loop $webglobal[page_purview][dataarray] $groupid $groupvalue}-->
		<table id="tab_{$groupid}" class="datatable" cellspacing="1"{if $groupvalue[groupnum] != 1} style="display:none;"{/if}>
		<thead> 
			<tr>
				<th width="5%"></th>
				<th width="5%">编号</th>
				<th width="15%">权限组</th>
				<th width="25%">权限名称</th>
				<th width="20%">对应操作</th>
				<th width="20%">额外链接</th>
				<th width="10%">排序</th>
			</tr>
		</thead>
		<tbody>
		<!--{if isset($groupvalue[subpurview]) && $groupvalue[subpurview]}-->
			<!--{loop $groupvalue[subpurview] $purviewid $purviewvalue}-->
			<tr>
				<td{$purviewvalue[tdclass]}><input class="selectUnit" type="checkbox" name="delid[]" value="{$purviewid}" /></td>
				<td{$purviewvalue[tdclass]}>{$purviewvalue[id]}</td>
				<td{$purviewvalue[tdclass]}>
					<select name="groupid[{$purviewid}]">
					<!--{loop $webglobal[page_purview][purviewgroup] $key $value}-->
					<option value="{$key}"{if $purviewvalue[upid] == $key} selected{/if}>{$value[name]}</option>
					<!--{/loop}-->
					</select>
				</td>
				<td{$purviewvalue[tdclass]}><input type="text" name="name[{$purviewid}]" value="{$purviewvalue[name]}" style="width:200px" /></td>
				<td{$purviewvalue[tdclass]}><input type="text" name="webmode[{$purviewid}]" value="{$purviewvalue[mode]}" /></td>
				<td{$purviewvalue[tdclass]}><input type="text" name="linkmore[{$purviewid}]" value="{$purviewvalue[linkmore]}" style="width:180px" /></td>
				<td{$purviewvalue[tdclass]}>
					<input type="text" name="order[{$purviewid}]" value="{$purviewvalue[order]}" style="width:50px" />
				</td>
			</tr>
			<!--{/loop}-->
		<!--{else}-->
			<tr><td colspan="7" style="text-align: center">该分组下面还没有权限。</td></tr>
		<!--{/if}-->
		</tbody>
		</table>
	<!--{/loop}-->
	<table style="width:100%;border-style:none;" cellpadding="0" cellspacing="0">
		<tr>
			<td style="width:80px;margin:0;padding:0;">
			<input onclick="selectallbutton()" type="button" value="全选">
			<input type="submit" name="adminsubmit" value=" 批量更改 " />
			<input id ="selecthidden" type="hidden" value="0" />
			</td>
		</tr>
	</table>
	<script type="text/javascript">
			function selectallbutton() {
			if($('#selecthidden').val()==0){
				$('#selecthidden').val('1');
			}else{
				$('#selecthidden').val('0');
			}
			$('.selectUnit').each(function(){
				if($('#selecthidden').val()=='1'){
					$(this).attr('checked',true);
				}else{
					$(this).attr('checked',false);
				}
			});
		}
		</script>
	<!--{/if}-->
	</form>

<!--{elseif $webglobal[mode]=='purviewadd'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>权限分组管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=purview">[权限列表]</a>
			</td></tr>
		</tbody>
	</table>
	<form name="addform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=purviewadd&check">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">添加权限</td></tr>
		</thead>
		<tbody>
			<tr>
				<th>所属权限分组<span class="need"> *</span></th>
				<td>
					<select name="groupid">
						<option value="">请选择..</option>
						<!--{if $webglobal[page_purview]['group']}-->
						<!--{loop $webglobal[page_purview][group] $groupid $groupvalue}-->
						<option value="{$groupid}">{$groupvalue[name]}</option>
						<!--{/loop}-->
						<!--{/if}-->
					</select>
				</td>
			</tr>
			<tr>
				<th>权限名称<span class="need"> *</span></th>
				<td>
					<input type="text" name="name" size="40" value="" />
				</td>
			</tr>
			<tr>
				<th>对应操作<span class="need"> *</span></th>
				<td>
					<input type="text" name="webmode" size="40" value="" />
				</td>
			</tr>
			<tr>
				<th>额外链接参数</th>
				<td>
					<input type="text" name="linkmore" size="40" value="" />
				</td>
			</tr>
			<tr>
				<th>排序<div>越大越排前面，小于0不显示</div></th>
				<td>
					<input type="text" name="order" size="10" value="0" />
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="2">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{/if}-->

{template footer}